public class Test {
public static int fact(int n){

if(n==1){
    return 1;
}
return n*fact(n-1);


}

public static void fib(int n){

    int a=1,b=1,c=0;
    while(c<n){
        System.out.print(a+" ");
        c=a+b;
        a=b;
        b=c;



    }


}
    public static void main(String[] args) {
//int a=fact(4);
fib(1000);
//        System.out.println(a);

    }
}
